﻿namespace Sidvall.FileSystemManager.UI.Entities
{
	public sealed partial class SearchConfig
	{
		#region GetItem

		public static SearchConfig GetItem(Sidvall.FileSystemManager.Net.Services.V1.SearchConfig dataItem)
		{
			SearchConfig item;

			if (dataItem == null)
				return null;
			item = new SearchConfig();
			item.Import(dataItem, Sidvall.Data.CopySettings.FullCopyAll(Sidvall.Data.DataRowContextOption.None, null));

			return item;
		}

		#endregion

		#region Deserialize

		public static SearchConfig Deserialize(string value)
		{
			Sidvall.FileSystemManager.Net.Services.V1.SearchConfig dataItem;
			SearchConfig item;

			dataItem = Sidvall.FileSystemManager.Net.Services.V1.SearchConfig.Deserialize(value);
			item = GetItem(dataItem);
			item.AcceptChanges();

			return item;
		}

		#endregion
		#region Serialize

		public string Serialize()
		{
			return Serialize(this);
		}
		public static string Serialize(SearchConfig item)
		{
			Sidvall.FileSystemManager.Net.Services.V1.SearchConfig dataItem;

			dataItem = new Net.Services.V1.SearchConfig();
			dataItem.Import(item, Sidvall.Data.CopySettings.FullCopyAll(Sidvall.Data.DataRowContextOption.None, null));

			return Sidvall.Serialization.SerializerManager.Current.SerializeObject(dataItem);
		}

		#endregion
	}
}